#ifndef SOCKETINSTANCE_H
#define SOCKETINSTANCE_H

#include <winsock2.h>
#include "SocketException.h"

class SocketInstance
{
public:
	SocketInstance(SOCKET passedsockfd);
	~SocketInstance();

	SOCKET GetSocket() const;
	bool IsClosed() const;
	int GetReferenceCount() const;
	void IncreaseReference();
	void DecreaseReference();
	void Close();

private:
	SocketInstance(const SocketInstance& rhs); // copy-constructor not implemented

	bool closed;
	int reference;

	SOCKET sockfd;
};

#endif // SOCKETINSTANCE_H

